package org.example.mydeom.config;


import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenApi {
    //SpringDoc OpenAPI配置
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("API 文档")
                        .version("1.0")
                        .description("MyDemo"))
                .externalDocs(new ExternalDocumentation()
                        .description("参考文档")
                        .url("https://springdoc.org")
                );
    }

//    @Bean
//    public OpenApiCustomiser schemaCustomiser() {
//        return openApi -> openApi.getComponents().getSchemas().values()
//                .forEach(schema -> schema.setAdditionalProperties(null));
//    }
}
